package gwtmodule1.client.gui.salesdept;

import gwtmodule1.client.gui.shared.OrderTable;
import gwtmodule1.client.gui.utils.FrameClient;
import gwtmodule1.client.gui.utils.FrameProvider;
import gwtmodule1.client.gui.utils.Title;

import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class PageAdminOrders extends VerticalPanel implements FrameClient {

	private PageEditOrderItems pageEditOrderItems = new PageEditOrderItems();

	private PageEditShipping pageEditShipping = new PageEditShipping();

	private PageViewOrder pageViewOrder = new PageViewOrder();

	private FrameProvider provider;

	public PageAdminOrders(FrameProvider provider) {
		super();
		this.provider = provider;
		add(new Title("Administrate Orders"));
		add(createTable());
	}

	private Widget createTable() {
		OrderTable table = new OrderTable(provider, pageViewOrder);
		table.setAdminLinks(pageEditOrderItems, pageEditShipping);
		
		table.addItem(3213, "12/24/06", "Peter", 23, 546.78f, "shipped");
		table.addItem(3215, "12/27/06", "Peter", 11, 324.78f, "shipped");
		table.addItem(3267, "01/20/07", "Peter", 3, 534f, "shipped");
		table.addItem(3268, "02/24/07", "Peter", 2, 554f, "not shipped");

		return table;
	}

	public void onShow(Object param) {
	}

}
